package offersimple

import "ming/algorithm-for-go/leetcode/simple/model"

func reverseList(head *model.ListNode) *model.ListNode {

	var (
		cur *model.ListNode = nil
		pre                 = head
	)
	for pre != nil {
		temp := pre.Next
		pre.Next = cur
		cur = pre
		pre = temp
	}

	return cur
}
